home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Hardware / PowerManager DDK 1.0f1 / Interfaces&Libraries / Interfaces / ConditionalMacros.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-08  |  54.7 KB  |  1,748 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.h
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Universal Interface Files 3.2+
  7.  
  8.      DRI:        Nick Kledzik
  9.  
  10.      Copyright:    © 1993-1999 by Apple Computer, Inc., all rights reserved
  11.  
  12.      Warning:    *** APPLE INTERNAL USE ONLY ***
  13.                  This file may contain unreleased API's
  14.  
  15.      BuildInfo:    Built by:            Scott Johnson
  16.                  On:                    10/8/99 11:26 AM
  17.                  With Interfacer:    3.0d13   (MPW PowerPC)
  18.                  From:                ConditionalMacros.i
  19.                      Revision:        115
  20.                      Dated:            4/27/99
  21.                      Last change by:    ngk
  22.                      Last comment:    [2326220]  define SLASH_INCLUDES_UNSUPPORTED for MW IDE
  23.  
  24.      Bugs:        Report bugs to Radar component "System Interfaces", "Latest"
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28. #ifndef __CONDITIONALMACROS__
  29. #define __CONDITIONALMACROS__
  30.  
  31. /****************************************************************************************************
  32.     UNIVERSAL_INTERFACES_VERSION
  33.     
  34.         0x0320 => version 3.2
  35.         0x0310 => version 3.1
  36.         0x0301 => version 3.0.1
  37.         0x0300 => version 3.0
  38.         0x0210 => version 2.1
  39.         This conditional did not exist prior to version 2.1
  40. ****************************************************************************************************/
  41. #define UNIVERSAL_INTERFACES_VERSION 0x0321
  42.  
  43. /****************************************************************************************************
  44.  
  45.     TARGET_CPU_≈    
  46.     These conditionals specify which microprocessor instruction set is being
  47.     generated.  At most one of these is true, the rest are false.
  48.  
  49.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  50.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  51.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  52.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  53.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  54.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  55.  
  56.  
  57.     TARGET_OS_≈    
  58.     These conditionals specify in which Operating System the generated code will
  59.     run. At most one of the these is true, the rest are false.
  60.  
  61.         TARGET_OS_MAC            - Generate code will run under Mac OS
  62.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  63.         TARGET_OS_UNIX            - Generate code will run under some unix 
  64.  
  65.  
  66.     TARGET_RT_≈    
  67.     These conditionals specify in which runtime the generated code will
  68.     run. This is needed when the OS and CPU support more than one runtime
  69.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  70.  
  71.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  72.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  73.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used
  74.         TARGET_RT_MAC_MACHO     - TARGET_OS_MAC is true and Mach-O style runtime
  75.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  76.  
  77.  
  78.     TARGET__API_≈_≈    
  79.     These conditionals are used to differentiate between sets of API's on the same
  80.     processor under the same OS.  The first section after _API_ is the OS.  The
  81.     second section is the API set.  Unlike TARGET_OS_ and TARGET_CPU_, these
  82.     conditionals are not mutally exclusive. This file will attempt to auto-configure
  83.     all TARGET_API_≈_≈ values, but will often need a TARGET_API_≈_≈ value predefined
  84.     in order to disambiguate.
  85.     
  86.         TARGET_API_MAC_OS8      - Code is being compiled to run on System 7 through Mac OS 8.x
  87.         TARGET_API_MAC_CARBON   - Code is being compiled to run on Mac OS 8 and Mac OS X via CarbonLib
  88.         TARGET_API_MAC_OSX      - Code is being compiled to run on Mac OS X
  89.  
  90.  
  91.     PRAGMA_≈
  92.     These conditionals specify whether the compiler supports particular #pragma's
  93.     
  94.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  95.         PRAGMA_ONCE              - Compiler supports: #pragma once
  96.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  97.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  98.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  99.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  100.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  101.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  102.  
  103.  
  104.     FOUR_CHAR_CODE
  105.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  106.     is compiled down to the correct value on all compilers.
  107.  
  108.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  109.  
  110.  
  111.     TYPE_≈
  112.     These conditionals specify whether the compiler supports particular types.
  113.  
  114.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  115.         TYPE_BOOL                - Compiler supports "bool"
  116.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  117.  
  118.  
  119.     FUNCTION_≈
  120.     These conditionals specify whether the compiler supports particular language extensions
  121.     to function prototypes and definitions.
  122.  
  123.         FUNCTION_PASCAL            - Compiler supports "pascal void Foo()"
  124.         FUNCTION_DECLSPEC        - Compiler supports "__declspec(xxx) void Foo()"
  125.         FUNCTION_WIN32CC        - Compiler supports "void __cdecl Foo()" and "void __stdcall Foo()"
  126.  
  127. ****************************************************************************************************/
  128.  
  129. #if defined(__MRC__)
  130.     /*
  131.         MrC[pp] compiler from Apple Computer, Inc.
  132.     */
  133.     #define TARGET_CPU_PPC              1
  134.     #define TARGET_CPU_68K              0
  135.     #define TARGET_CPU_X86              0
  136.     #define TARGET_CPU_MIPS             0
  137.     #define TARGET_CPU_SPARC            0        
  138.     #define TARGET_CPU_ALPHA            0
  139.     #define TARGET_OS_MAC                1
  140.     #define TARGET_OS_WIN32                0
  141.     #define TARGET_OS_UNIX                0
  142.     #define TARGET_RT_LITTLE_ENDIAN        0
  143.     #define TARGET_RT_BIG_ENDIAN        1
  144.     #define TARGET_RT_MAC_CFM            1
  145.     #define TARGET_RT_MAC_MACHO            0
  146.     #define TARGET_RT_MAC_68881            0
  147.     #if (__MRC__  > 0x0200) && (__MRC__ < 0x0700)
  148.         #define PRAGMA_IMPORT            1
  149.     #else
  150.         #define PRAGMA_IMPORT            0
  151.     #endif
  152.     #define PRAGMA_STRUCT_ALIGN            1
  153.     #define PRAGMA_ONCE                    1
  154.     #define PRAGMA_STRUCT_PACK            0
  155.     #define PRAGMA_STRUCT_PACKPUSH        0
  156.     #define PRAGMA_ENUM_PACK            1
  157.     #define PRAGMA_ENUM_ALWAYSINT        0
  158.     #define PRAGMA_ENUM_OPTIONS            0
  159.     #define FOUR_CHAR_CODE(x)            (x)
  160.         
  161.     #if (__MRC__  > 0x0300) && (__MRC__ < 0x0700)
  162.         #if __option(longlong)
  163.             #define TYPE_LONGLONG        1
  164.         #else
  165.             #define TYPE_LONGLONG        0
  166.         #endif
  167.         #if __option(bool)
  168.             #define TYPE_BOOL            1
  169.         #else
  170.             #define TYPE_BOOL            0
  171.         #endif
  172.         #define SLASH_INCLUDES_UNSUPPORTED        !__option(unix_includes)
  173.     #else
  174.         #define TYPE_LONGLONG            0
  175.         #define TYPE_BOOL                0
  176.         #define SLASH_INCLUDES_UNSUPPORTED        1
  177.     #endif
  178.     #define TYPE_EXTENDED                0
  179.     
  180.     #define FUNCTION_PASCAL                1
  181.     #define FUNCTION_DECLSPEC            0
  182.     #define FUNCTION_WIN32CC            0
  183.     
  184.  
  185.  
  186. #elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
  187.     /*
  188.         SC[pp] compiler from Apple Computer, Inc.
  189.     */
  190.     #define TARGET_CPU_PPC              0
  191.     #define TARGET_CPU_68K              1
  192.     #define TARGET_CPU_X86              0
  193.     #define TARGET_CPU_MIPS             0
  194.     #define TARGET_CPU_SPARC            0        
  195.     #define TARGET_CPU_ALPHA            0
  196.     #define TARGET_OS_MAC                1
  197.     #define TARGET_OS_WIN32                0
  198.     #define TARGET_OS_UNIX                0
  199.     #define TARGET_RT_LITTLE_ENDIAN        0
  200.     #define TARGET_RT_BIG_ENDIAN        1
  201.     #if defined(__CFM68K__)
  202.         #define TARGET_RT_MAC_CFM        1
  203.     #else
  204.         #define TARGET_RT_MAC_CFM        0
  205.     #endif
  206.     #define TARGET_RT_MAC_MACHO            0
  207.     #if defined(mc68881)
  208.         #define TARGET_RT_MAC_68881        1
  209.     #else
  210.         #define TARGET_RT_MAC_68881        0
  211.     #endif
  212.     #if TARGET_RT_MAC_CFM 
  213.         #define PRAGMA_IMPORT            1
  214.         #if (__SC__ <= 0x0810)
  215.             /* old versions of SC don't support “#pragma import reset” */
  216.             #define PRAGMA_IMPORT_OFF    1
  217.         #endif
  218.     #else
  219.         #define PRAGMA_IMPORT            0
  220.     #endif
  221.     #if (__SC__  >= 0x0801)
  222.         #define PRAGMA_STRUCT_ALIGN        1
  223.     #else
  224.         #define PRAGMA_STRUCT_ALIGN        0
  225.     #endif
  226.     #define PRAGMA_ONCE                    0
  227.     #define PRAGMA_STRUCT_PACK            0
  228.     #define PRAGMA_STRUCT_PACKPUSH        0
  229.     #define PRAGMA_ENUM_PACK            1
  230.     #define PRAGMA_ENUM_ALWAYSINT        0
  231.     #define PRAGMA_ENUM_OPTIONS            0
  232.     #define FOUR_CHAR_CODE(x)            (x)
  233.     
  234.     #define TYPE_LONGLONG                0
  235.     #define TYPE_EXTENDED                1
  236.     #if (__SC__  > 0x0810)
  237.         #if __option(bool)
  238.             #define TYPE_BOOL            1
  239.         #else
  240.             #define TYPE_BOOL            0
  241.         #endif
  242.     #else
  243.         #define TYPE_BOOL                0
  244.     #endif
  245.     #if TARGET_RT_MAC_CFM
  246.         #define FUNCTION_PASCAL            0
  247.     #else
  248.         #define FUNCTION_PASCAL            1
  249.     #endif
  250.     #define FUNCTION_DECLSPEC            0
  251.     #define FUNCTION_WIN32CC            0        
  252.     #define SLASH_INCLUDES_UNSUPPORTED    !__option(unix_includes)
  253.  
  254.  
  255. #elif defined(__MWERKS__)
  256.     /*
  257.         CodeWarrior compiler from Metrowerks, Inc.
  258.     */
  259.     #if (__MWERKS__ < 0x0900) || macintosh
  260.         #define TARGET_OS_MAC                1
  261.         #define TARGET_OS_WIN32                0
  262.         #define TARGET_OS_UNIX                0
  263.         #define TARGET_CPU_X86              0
  264.         #define TARGET_CPU_MIPS             0
  265.         #define TARGET_CPU_SPARC            0        
  266.         #define TARGET_CPU_ALPHA            0
  267.         #define TARGET_RT_LITTLE_ENDIAN        0
  268.         #define TARGET_RT_BIG_ENDIAN        1
  269.         #if powerc
  270.             #define TARGET_CPU_PPC          1
  271.             #define TARGET_CPU_68K          0
  272.             #define TARGET_RT_MAC_CFM        1
  273.             #define TARGET_RT_MAC_MACHO        0
  274.             #define TARGET_RT_MAC_68881        0
  275.         #else
  276.             #define TARGET_CPU_PPC          0
  277.             #define TARGET_CPU_68K          1
  278.             #if defined(__CFM68K__)
  279.                 #define TARGET_RT_MAC_CFM    1
  280.             #else
  281.                 #define TARGET_RT_MAC_CFM    0
  282.             #endif
  283.             #define TARGET_RT_MAC_MACHO        0
  284.             #if __MC68881__
  285.                 #define TARGET_RT_MAC_68881    1
  286.             #else
  287.                 #define TARGET_RT_MAC_68881    0
  288.             #endif
  289.         #endif
  290.         #define PRAGMA_ONCE                    1
  291.         #if (__MWERKS__ >= 0x0700)
  292.             #define PRAGMA_IMPORT            TARGET_RT_MAC_CFM
  293.         #else
  294.             #define PRAGMA_IMPORT            0
  295.         #endif
  296.         #define PRAGMA_STRUCT_ALIGN            1
  297.         #define PRAGMA_STRUCT_PACK            0
  298.         #define PRAGMA_STRUCT_PACKPUSH        0
  299.         #define PRAGMA_ENUM_PACK            0
  300.         #define PRAGMA_ENUM_ALWAYSINT        1
  301.         #define PRAGMA_ENUM_OPTIONS            0
  302.         #define FOUR_CHAR_CODE(x)            (x)
  303.         #if TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  304.             #define FUNCTION_PASCAL            1
  305.         #else
  306.             #define FUNCTION_PASCAL            1
  307.         #endif
  308.         #if (__MWERKS__ >= 0x2000)
  309.             #define FUNCTION_DECLSPEC        1
  310.         #else
  311.             #define FUNCTION_DECLSPEC        0
  312.         #endif
  313.         #define FUNCTION_WIN32CC            0        
  314.  
  315.     
  316.     #elif (__MWERKS__ >= 0x0900) && __INTEL__
  317.         #define TARGET_CPU_PPC              0
  318.         #define TARGET_CPU_68K              0
  319.         #define TARGET_CPU_X86              1
  320.         #define TARGET_CPU_MIPS             0
  321.         #define TARGET_CPU_SPARC            0        
  322.         #define TARGET_CPU_ALPHA            0
  323.         #define TARGET_OS_MAC                0
  324.         #define TARGET_OS_WIN32                1
  325.         #define TARGET_OS_UNIX                0
  326.         #define TARGET_RT_LITTLE_ENDIAN        1
  327.         #define TARGET_RT_BIG_ENDIAN        0
  328.         #define PRAGMA_ONCE                    1
  329.         #define PRAGMA_IMPORT                0
  330.         #define PRAGMA_STRUCT_ALIGN            0
  331.         #define PRAGMA_STRUCT_PACK            1
  332.         #define PRAGMA_STRUCT_PACKPUSH        1
  333.         #define PRAGMA_ENUM_PACK            0
  334.         #define PRAGMA_ENUM_ALWAYSINT        1
  335.         #define PRAGMA_ENUM_OPTIONS            0
  336.         #define FOUR_CHAR_CODE(x)            (x)
  337.         #define FUNCTION_PASCAL                0
  338.         #define FUNCTION_DECLSPEC            1
  339.         #define FUNCTION_WIN32CC            1        
  340.  
  341.  
  342.     #elif (__MWERKS__ >= 0x1900) && __MIPS__
  343.         #define TARGET_CPU_PPC              0
  344.         #define TARGET_CPU_68K              0
  345.         #define TARGET_CPU_X86              0
  346.         #define TARGET_CPU_MIPS             1
  347.         #define TARGET_CPU_SPARC            0        
  348.         #define TARGET_CPU_ALPHA            0
  349.         #define TARGET_OS_MAC                0
  350.         #define TARGET_OS_WIN32                0
  351.         #define TARGET_OS_UNIX                1
  352.         #if __option(little_endian)
  353.             #define TARGET_RT_LITTLE_ENDIAN    1
  354.             #define TARGET_RT_BIG_ENDIAN    0
  355.         #else
  356.             #define TARGET_RT_LITTLE_ENDIAN    0
  357.             #define TARGET_RT_BIG_ENDIAN    1
  358.         #endif
  359.         #define PRAGMA_ONCE                    1
  360.         #define PRAGMA_IMPORT                0
  361.         #define PRAGMA_STRUCT_ALIGN            0
  362.         #define PRAGMA_STRUCT_PACK            1
  363.         #define PRAGMA_STRUCT_PACKPUSH        0
  364.         #define PRAGMA_ENUM_PACK            0
  365.         #define PRAGMA_ENUM_ALWAYSINT        1
  366.         #define PRAGMA_ENUM_OPTIONS            0
  367.         #define FOUR_CHAR_CODE(x)            (x)
  368.         #define FUNCTION_PASCAL                0
  369.         #define FUNCTION_DECLSPEC            0
  370.         #define FUNCTION_WIN32CC            0            
  371.  
  372.  
  373.     #elif (__MWERKS__ >= 0x2110) && __MACH__
  374.         #define TARGET_CPU_PPC              1
  375.         #define TARGET_CPU_68K              0
  376.         #define TARGET_CPU_X86              0
  377.         #define TARGET_CPU_MIPS             0
  378.         #define TARGET_CPU_SPARC            0        
  379.         #define TARGET_CPU_ALPHA            0
  380.         #define TARGET_OS_MAC                1    
  381.         #define TARGET_OS_WIN32                0
  382.         #define TARGET_OS_UNIX                0
  383.         #if __option(little_endian)
  384.             #define TARGET_RT_LITTLE_ENDIAN    1
  385.             #define TARGET_RT_BIG_ENDIAN    0
  386.         #else
  387.             #define TARGET_RT_LITTLE_ENDIAN    0
  388.             #define TARGET_RT_BIG_ENDIAN    1
  389.         #endif
  390.         #define TARGET_RT_MAC_CFM            0
  391.         #define TARGET_RT_MAC_MACHO            1
  392.         #define TARGET_RT_MAC_68881            0
  393.         #define PRAGMA_ONCE                    1
  394.         #define PRAGMA_IMPORT                0
  395.         #define PRAGMA_STRUCT_ALIGN            1
  396.         #define PRAGMA_STRUCT_PACK            1
  397.         #define PRAGMA_STRUCT_PACKPUSH        0
  398.         #define PRAGMA_ENUM_PACK            0
  399.         #define PRAGMA_ENUM_ALWAYSINT        1
  400.         #define PRAGMA_ENUM_OPTIONS            0
  401.         #define FOUR_CHAR_CODE(x)            (x)
  402.         #define FUNCTION_PASCAL                1
  403.         #define FUNCTION_DECLSPEC            1
  404.         #define FUNCTION_WIN32CC            0            
  405.     #else    
  406.         #error unknown Metrowerks compiler
  407.     #endif
  408.  
  409.  
  410.     #if (__MWERKS__ >= 0x1100)
  411.         #if __option(longlong)
  412.             #define TYPE_LONGLONG        1
  413.         #else
  414.             #define TYPE_LONGLONG        0
  415.         #endif
  416.     #else
  417.         #define TYPE_LONGLONG            0
  418.     #endif
  419.     #if (__MWERKS__ >= 0x1000)
  420.         #if __option(bool)
  421.             #define TYPE_BOOL            1
  422.         #else
  423.             #define TYPE_BOOL            0
  424.         #endif
  425.     #else
  426.         #define TYPE_BOOL                0
  427.     #endif
  428.     #define TYPE_EXTENDED                0
  429.     #define SLASH_INCLUDES_UNSUPPORTED    1
  430.  
  431.  
  432. #elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
  433.     /*
  434.         C and C++ compiler from Symantec, Inc.
  435.     */
  436.     #define TARGET_OS_MAC                1
  437.     #define TARGET_OS_WIN32                0
  438.     #define TARGET_OS_UNIX                0
  439.     #define TARGET_CPU_X86              0
  440.     #define TARGET_CPU_MIPS             0
  441.     #define TARGET_CPU_SPARC            0        
  442.     #define TARGET_CPU_ALPHA            0
  443.     #define TARGET_RT_LITTLE_ENDIAN        0
  444.     #define TARGET_RT_BIG_ENDIAN        1
  445.     #if powerc
  446.         #define TARGET_CPU_PPC          1
  447.         #define TARGET_CPU_68K          0
  448.         #define TARGET_RT_MAC_CFM        1
  449.         #define TARGET_RT_MAC_MACHO        0
  450.         #define TARGET_RT_MAC_68881        0
  451.     #else
  452.         #define TARGET_CPU_PPC          0
  453.         #define TARGET_CPU_68K          1
  454.         #if defined(__CFM68K)
  455.             #define TARGET_RT_MAC_CFM    1
  456.         #else
  457.             #define TARGET_RT_MAC_CFM    0
  458.         #endif
  459.         #define TARGET_RT_MAC_MACHO        0
  460.         #if mc68881
  461.             #define TARGET_RT_MAC_68881    1
  462.         #else
  463.             #define TARGET_RT_MAC_68881    0
  464.         #endif
  465.     #endif
  466.     #define PRAGMA_IMPORT                0
  467.     #define PRAGMA_ONCE                    1
  468.     #define PRAGMA_STRUCT_ALIGN            1
  469.     #define PRAGMA_STRUCT_PACK            0
  470.     #define PRAGMA_STRUCT_PACKPUSH        0
  471.     #define PRAGMA_ENUM_PACK            1
  472.     #define PRAGMA_ENUM_ALWAYSINT        0
  473.     #define PRAGMA_ENUM_OPTIONS            0
  474.     #define FOUR_CHAR_CODE(x)            (x)
  475.     
  476.     #if __useAppleExts__
  477.         #define TYPE_EXTENDED            1
  478.     #else
  479.         #define TYPE_EXTENDED            0
  480.     #endif
  481.     #define TYPE_LONGLONG                0
  482.     #define TYPE_BOOL                    0
  483.     
  484.     #define FUNCTION_PASCAL                0
  485.     #define FUNCTION_DECLSPEC            0
  486.     #define FUNCTION_WIN32CC            0            
  487.     #define SLASH_INCLUDES_UNSUPPORTED    1
  488.  
  489.  
  490. #elif defined(THINK_C)
  491.     /*
  492.         THINK C compiler from Symantec, Inc.        << WARNING: Unsupported Compiler >>
  493.     */
  494.     #define TARGET_CPU_PPC              0
  495.     #define TARGET_CPU_68K              1
  496.     #define TARGET_CPU_X86              0
  497.     #define TARGET_CPU_MIPS             0
  498.     #define TARGET_CPU_SPARC            0        
  499.     #define TARGET_CPU_ALPHA            0
  500.     #define TARGET_OS_MAC                1
  501.     #define TARGET_OS_WIN32                0
  502.     #define TARGET_OS_UNIX                0
  503.     #define TARGET_RT_LITTLE_ENDIAN        0
  504.     #define TARGET_RT_BIG_ENDIAN        1
  505.     #define TARGET_RT_MAC_CFM            0
  506.     #define TARGET_RT_MAC_MACHO            0
  507.     #if defined(mc68881)
  508.         #define TARGET_RT_MAC_68881        1
  509.     #else
  510.         #define TARGET_RT_MAC_68881        0
  511.     #endif
  512.     #define PRAGMA_IMPORT                0
  513.     #define PRAGMA_STRUCT_ALIGN            0
  514.     #define PRAGMA_ONCE                    1
  515.     #define PRAGMA_STRUCT_PACK            0
  516.     #define PRAGMA_STRUCT_PACKPUSH        0
  517.     #define PRAGMA_ENUM_PACK            1
  518.     #define PRAGMA_ENUM_ALWAYSINT        0
  519.     #define PRAGMA_ENUM_OPTIONS            0
  520.     #define FOUR_CHAR_CODE(x)            (x)
  521.     
  522.     #define TYPE_EXTENDED                1
  523.     #define TYPE_LONGLONG                0
  524.     #define TYPE_BOOL                    0
  525.     
  526.     #define FUNCTION_PASCAL                1
  527.     #define FUNCTION_DECLSPEC            0
  528.     #define FUNCTION_WIN32CC            0
  529.     #define SLASH_INCLUDES_UNSUPPORTED    1
  530.  
  531.  
  532. #elif defined(__PPCC__)
  533.     /*
  534.         PPCC compiler from Apple Computer, Inc.        << WARNING: Unsupported Compiler >>
  535.     */
  536.     #define TARGET_CPU_PPC              1
  537.     #define TARGET_CPU_68K              0
  538.     #define TARGET_CPU_X86              0
  539.     #define TARGET_CPU_MIPS             0
  540.     #define TARGET_CPU_SPARC            0        
  541.     #define TARGET_CPU_ALPHA            0
  542.     #define TARGET_OS_MAC                1
  543.     #define TARGET_OS_WIN32                0
  544.     #define TARGET_OS_UNIX                0
  545.     #define TARGET_RT_LITTLE_ENDIAN        0
  546.     #define TARGET_RT_BIG_ENDIAN        1
  547.     #define TARGET_RT_MAC_CFM            1
  548.     #define TARGET_RT_MAC_MACHO            0
  549.     #define TARGET_RT_MAC_68881            0
  550.     #define PRAGMA_IMPORT                0
  551.     #define PRAGMA_STRUCT_ALIGN            1
  552.     #define PRAGMA_ONCE                    0
  553.     #define PRAGMA_STRUCT_PACK            0
  554.     #define PRAGMA_STRUCT_PACKPUSH        0
  555.     #define PRAGMA_ENUM_PACK            0
  556.     #define PRAGMA_ENUM_ALWAYSINT        0
  557.     #define PRAGMA_ENUM_OPTIONS            0
  558.     #define FOUR_CHAR_CODE(x)            (x)
  559.     
  560.     #define TYPE_EXTENDED                0
  561.     #define TYPE_LONGLONG                0
  562.     #define TYPE_BOOL                    0
  563.     
  564.     #define FUNCTION_PASCAL                0
  565.     #define FUNCTION_DECLSPEC            0
  566.     #define FUNCTION_WIN32CC            0            
  567.     #define SLASH_INCLUDES_UNSUPPORTED    1
  568.  
  569.  
  570. #elif defined(applec) && !defined(__SC__)
  571.     /*
  572.         MPW C compiler from Apple Computer, Inc.    << WARNING: Unsupported Compiler >>
  573.     */
  574.     #define TARGET_CPU_PPC              0
  575.     #define TARGET_CPU_68K              1
  576.     #define TARGET_CPU_X86              0
  577.     #define TARGET_CPU_MIPS             0
  578.     #define TARGET_CPU_SPARC            0        
  579.     #define TARGET_CPU_ALPHA            0
  580.     #define TARGET_OS_MAC                1
  581.     #define TARGET_OS_WIN32                0
  582.     #define TARGET_OS_UNIX                0
  583.     #define TARGET_RT_LITTLE_ENDIAN        0
  584.     #define TARGET_RT_BIG_ENDIAN        1
  585.     #define TARGET_RT_MAC_CFM            0
  586.     #define TARGET_RT_MAC_MACHO            0
  587.     #if defined(mc68881)
  588.         #define TARGET_RT_MAC_68881        1
  589.     #else
  590.         #define TARGET_RT_MAC_68881        0
  591.     #endif
  592.     #define PRAGMA_IMPORT                0
  593.     #define PRAGMA_STRUCT_ALIGN            0
  594.     #define PRAGMA_ONCE                    0
  595.     #define PRAGMA_STRUCT_PACK            0
  596.     #define PRAGMA_STRUCT_PACKPUSH        0
  597.     #define PRAGMA_ENUM_PACK            0
  598.     #define PRAGMA_ENUM_ALWAYSINT        0
  599.     #define PRAGMA_ENUM_OPTIONS            0
  600.     /* Note: MPW C 3.2 had a bug where MACRO('xx   ') would cause 'xx  ' to be misevaluated */
  601.     #define FOUR_CHAR_CODE                
  602.  
  603.     #define TYPE_EXTENDED                1
  604.     #define TYPE_LONGLONG                0
  605.     #define TYPE_BOOL                    0
  606.  
  607.     #define FUNCTION_PASCAL                1
  608.     #define FUNCTION_DECLSPEC            0
  609.     #define FUNCTION_WIN32CC            0            
  610.     #define SLASH_INCLUDES_UNSUPPORTED    1
  611.  
  612.  
  613. #elif defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__NEXT_CPP__))
  614.     /*
  615.         gcc based compilers used on OpenStep -> Rhapsody -> Mac OS X
  616.     */
  617.     #if defined(__ppc__) || defined(powerpc) || defined(ppc)
  618.         #define TARGET_CPU_PPC            1
  619.         #define TARGET_CPU_68K            0
  620.         #define TARGET_CPU_X86            0
  621.         #define TARGET_CPU_MIPS            0
  622.         #define TARGET_CPU_SPARC        0   
  623.         #define TARGET_CPU_ALPHA        0
  624.         #define TARGET_RT_MAC_CFM        0
  625.         #define TARGET_RT_MAC_MACHO        1
  626.         #define TARGET_RT_MAC_68881        0
  627.         #define TARGET_RT_LITTLE_ENDIAN    0
  628.         #define TARGET_RT_BIG_ENDIAN    1
  629.     #elif defined(m68k)
  630.         #define TARGET_CPU_PPC            0
  631.         #define TARGET_CPU_68K            1
  632.         #define TARGET_CPU_X86            0
  633.         #define TARGET_CPU_MIPS            0
  634.         #define TARGET_CPU_SPARC        0   
  635.         #define TARGET_CPU_ALPHA        0
  636.         #define TARGET_RT_MAC_CFM        0
  637.         #define TARGET_RT_MAC_MACHO        1
  638.         #define TARGET_RT_MAC_68881        0
  639.         #define TARGET_RT_LITTLE_ENDIAN 0
  640.         #define TARGET_RT_BIG_ENDIAN    1
  641.     #elif defined(sparc)
  642.         #define TARGET_CPU_PPC            0
  643.         #define TARGET_CPU_68K            0
  644.         #define TARGET_CPU_X86            0
  645.         #define TARGET_CPU_MIPS            0
  646.         #define TARGET_CPU_SPARC        1
  647.         #define TARGET_CPU_ALPHA        0
  648.         #define TARGET_RT_MAC_CFM        0
  649.         #define TARGET_RT_MAC_MACHO        1
  650.         #define TARGET_RT_MAC_68881        0
  651.         #define TARGET_RT_LITTLE_ENDIAN    0
  652.         #define TARGET_RT_BIG_ENDIAN    1
  653.     #elif defined(__i386__) || defined(i386) || defined(intel)
  654.         #define TARGET_CPU_PPC            0
  655.         #define TARGET_CPU_68K            0
  656.         #define TARGET_CPU_X86            1
  657.         #define TARGET_CPU_MIPS            0
  658.         #define TARGET_CPU_SPARC        0
  659.         #define TARGET_CPU_ALPHA        0
  660.         #define TARGET_RT_MAC_CFM        0
  661.         #define TARGET_RT_MAC_MACHO        1
  662.         #define TARGET_RT_MAC_68881        0
  663.         #define TARGET_RT_LITTLE_ENDIAN    1
  664.         #define TARGET_RT_BIG_ENDIAN    0
  665.     #else
  666.         #error unrecognized GNU C compiler
  667.     #endif
  668.  
  669.  
  670.     #define TARGET_OS_MAC                1
  671.     #define TARGET_OS_WIN32                0
  672.     #define TARGET_OS_UNIX                0
  673.  
  674.     #define PRAGMA_IMPORT                0
  675.     #define PRAGMA_STRUCT_ALIGN            1
  676.     #define PRAGMA_ONCE                    0
  677.     #define PRAGMA_STRUCT_PACK            0
  678.     #define PRAGMA_STRUCT_PACKPUSH        0
  679.     #define PRAGMA_ENUM_PACK            0
  680.     #define PRAGMA_ENUM_ALWAYSINT        0
  681.     #define PRAGMA_ENUM_OPTIONS            0
  682.     #define FOUR_CHAR_CODE(x)            (x)
  683.  
  684.     #define TYPE_EXTENDED                0
  685.     #if __GNUC__ >= 2
  686.         #define TYPE_LONGLONG            1
  687.     #else
  688.         #define TYPE_LONGLONG            0
  689.     #endif
  690.     #ifdef __cplusplus
  691.         #define TYPE_BOOL                1
  692.     #else
  693.         #define TYPE_BOOL                0
  694.     #endif
  695.     
  696.     #define FUNCTION_PASCAL                0
  697.     #define FUNCTION_DECLSPEC            0
  698.     #define FUNCTION_WIN32CC            0            
  699.  
  700.  
  701.     #if defined(forCarbon) && (forCarbon == 0)
  702.         /* BlueBox and Carbon both compile MI headers on Rhapsody.
  703.         Since cpp-precomp doesn't understand #question(answer), we can't
  704.         use #system(macos) to tell the difference anymore.  So the
  705.         solution is for BlueBox to -DforCarbon=0 on the compile line,
  706.         which we do NOT override here. */
  707.         /* BUT, we still need CFM=1, otherwise we get errors
  708.            for TempADBServiceRoutineUPP in DeskBus.i.  Mabye
  709.            this is fixed in TOT MI, but that creates other 
  710.            problems for BlueBox which still need to be solved. */
  711.         #undef TARGET_RT_MAC_CFM
  712.         #define TARGET_RT_MAC_CFM            1
  713.     #endif
  714.  
  715.  
  716. #elif defined(__GNUC__) && defined(__linux__)
  717.     /*
  718.         gcc (egcs, really) for MkLinux.                << WARNING: Unsupported Compiler >>
  719.     */
  720.     #if #cpu(powerpc)
  721.         #define TARGET_CPU_PPC          1
  722.         #define TARGET_CPU_68K          0
  723.         #define TARGET_CPU_X86          0
  724.         #define TARGET_CPU_MIPS         0
  725.         #define TARGET_CPU_SPARC        0    
  726.         #define TARGET_CPU_ALPHA        0
  727.         #define TARGET_RT_MAC_CFM        1
  728.         #define TARGET_RT_MAC_MACHO        0
  729.         #define TARGET_RT_MAC_68881        0
  730.     #elif #cpu(m68k)
  731.         #define TARGET_CPU_PPC          0
  732.         #define TARGET_CPU_68K          1
  733.         #define TARGET_CPU_X86          0
  734.         #define TARGET_CPU_MIPS         0
  735.         #define TARGET_CPU_SPARC        0    
  736.         #define TARGET_CPU_ALPHA        0
  737.         #define TARGET_RT_MAC_CFM        0
  738.         #define TARGET_RT_MAC_MACHO        0
  739.         #define TARGET_RT_MAC_68881        0
  740.     #else
  741.         #error unsupported GNU C compiler
  742.     #endif
  743.     
  744.     #if #system(macos)
  745.         #define TARGET_OS_MAC            1
  746.         #define TARGET_OS_WIN32            0
  747.         #define TARGET_OS_UNIX            0
  748.     #elif #system(unix)
  749.         #define TARGET_OS_MAC            0
  750.         #define TARGET_OS_WIN32            0
  751.         #define TARGET_OS_UNIX            1
  752.     #else
  753.         #error unsupported GNU C compiler
  754.     #endif
  755.  
  756.  
  757.     
  758.     #define TARGET_RT_LITTLE_ENDIAN        0
  759.     #define TARGET_RT_BIG_ENDIAN        1
  760.     #define PRAGMA_IMPORT                0
  761.     #define PRAGMA_STRUCT_ALIGN            0
  762.     #define PRAGMA_ONCE                    0
  763.     #define PRAGMA_STRUCT_PACK            1
  764.     #define PRAGMA_STRUCT_PACKPUSH        0
  765.     #define PRAGMA_ENUM_PACK            0
  766.     #define PRAGMA_ENUM_ALWAYSINT        0
  767.     #define PRAGMA_ENUM_OPTIONS            0
  768.     #define FOUR_CHAR_CODE(x)            (x)
  769.  
  770.     #define TYPE_EXTENDED                0
  771.     #ifdef _LONG_LONG
  772.         #define TYPE_LONGLONG            1
  773.     #else
  774.         #define TYPE_LONGLONG            0
  775.     #endif
  776.     #define TYPE_BOOL                    0
  777.     
  778.     #define FUNCTION_PASCAL                0
  779.     #define FUNCTION_DECLSPEC            0
  780.     #define FUNCTION_WIN32CC            0            
  781.  
  782.  
  783. #elif defined(__GNUC__)
  784.     /*
  785.         gC for MPW from Free Software Foundation, Inc.
  786.     */
  787.     #if #cpu(powerpc)
  788.         #define TARGET_CPU_PPC          1
  789.         #define TARGET_CPU_68K          0
  790.         #define TARGET_CPU_X86          0
  791.         #define TARGET_CPU_MIPS         0
  792.         #define TARGET_CPU_SPARC        0    
  793.         #define TARGET_CPU_ALPHA        0
  794.         #define TARGET_RT_MAC_CFM        1
  795.         #define TARGET_RT_MAC_MACHO        0
  796.         #define TARGET_RT_MAC_68881        0
  797.     #elif #cpu(m68k)
  798.         #define TARGET_CPU_PPC          0
  799.         #define TARGET_CPU_68K          1
  800.         #define TARGET_CPU_X86          0
  801.         #define TARGET_CPU_MIPS         0
  802.         #define TARGET_CPU_SPARC        0    
  803.         #define TARGET_CPU_ALPHA        0
  804.         #define TARGET_RT_MAC_CFM        0
  805.         #define TARGET_RT_MAC_MACHO        0
  806.         #define TARGET_RT_MAC_68881        0
  807.     #else
  808.         #error unsupported GNU C compiler
  809.     #endif
  810.     
  811.     #if #system(macos)
  812.         #define TARGET_OS_MAC            1
  813.         #define TARGET_OS_WIN32            0
  814.         #define TARGET_OS_UNIX            0
  815.     #elif #system(unix)
  816.         #define TARGET_OS_MAC            0
  817.         #define TARGET_OS_WIN32            0
  818.         #define TARGET_OS_UNIX            1
  819.     #else
  820.         #error unsupported GNU C compiler
  821.     #endif
  822.     
  823.     #define TARGET_RT_LITTLE_ENDIAN        0
  824.     #define TARGET_RT_BIG_ENDIAN        1
  825.     #define PRAGMA_IMPORT                0
  826.     #define PRAGMA_STRUCT_ALIGN            1
  827.     #define PRAGMA_ONCE                    0
  828.     #define PRAGMA_STRUCT_PACK            0
  829.     #define PRAGMA_STRUCT_PACKPUSH        0
  830.     #define PRAGMA_ENUM_PACK            0
  831.     #define PRAGMA_ENUM_ALWAYSINT        0
  832.     #define PRAGMA_ENUM_OPTIONS            0
  833.     #define FOUR_CHAR_CODE(x)            (x)
  834.  
  835.     #define TYPE_EXTENDED                0
  836.     #ifdef _LONG_LONG
  837.         #define TYPE_LONGLONG            1
  838.     #else
  839.         #define TYPE_LONGLONG            0
  840.     #endif
  841.     #define TYPE_BOOL                    0
  842.  
  843.     #define FUNCTION_PASCAL                0
  844.     #define FUNCTION_DECLSPEC            0
  845.     #define FUNCTION_WIN32CC            0            
  846.  
  847.  
  848. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  849.     /*
  850.         xlc and xlC on RS/6000 from IBM, Inc.
  851.     */
  852.     #define TARGET_CPU_PPC              1
  853.     #define TARGET_CPU_68K              0
  854.     #define TARGET_CPU_X86              0
  855.     #define TARGET_CPU_MIPS             0
  856.     #define TARGET_CPU_SPARC            0        
  857.     #define TARGET_CPU_ALPHA            0
  858.     #if defined(_AIX)
  859.         #define TARGET_OS_MAC            0
  860.         #define TARGET_OS_UNIX            1
  861.     #else
  862.         #define TARGET_OS_MAC            1
  863.         #define TARGET_OS_UNIX            0
  864.     #endif
  865.     #define TARGET_OS_WIN32                0
  866.     #define TARGET_RT_LITTLE_ENDIAN        0
  867.     #define TARGET_RT_BIG_ENDIAN        1
  868.     #define TARGET_RT_MAC_CFM            1
  869.     #define TARGET_RT_MAC_MACHO            0
  870.     #define TARGET_RT_MAC_68881            0
  871.     #define PRAGMA_IMPORT                0
  872.     #define PRAGMA_STRUCT_ALIGN            1
  873.     #define PRAGMA_ONCE                    0
  874.     #define PRAGMA_STRUCT_PACK            0
  875.     #define PRAGMA_STRUCT_PACKPUSH        0
  876.     #define PRAGMA_ENUM_PACK            0
  877.     #define PRAGMA_ENUM_ALWAYSINT        0
  878.     #define PRAGMA_ENUM_OPTIONS            1
  879.     #define FOUR_CHAR_CODE(x)            (x)
  880.  
  881.     #define TYPE_EXTENDED                0
  882.     #ifdef _LONG_LONG
  883.         #define TYPE_LONGLONG            1
  884.     #else
  885.         #define TYPE_LONGLONG            0
  886.     #endif
  887.     #define TYPE_BOOL                    0
  888.     
  889.     #define FUNCTION_PASCAL                0
  890.     #define FUNCTION_DECLSPEC            0
  891.     #define FUNCTION_WIN32CC            0            
  892.  
  893.  
  894. #elif defined(_MSC_VER) && !defined(__MWERKS__) 
  895.     /*
  896.         Visual C++ from Microsoft, Inc.
  897.     */
  898.     #if defined(_M_M68K)    /* Visual C++ with Macintosh 68K target */
  899.         #define TARGET_CPU_PPC              0
  900.         #define TARGET_CPU_68K              1
  901.         #define TARGET_CPU_X86              0
  902.         #define TARGET_CPU_MIPS             0
  903.         #define TARGET_CPU_SPARC            0
  904.         #define TARGET_CPU_ALPHA            0
  905.         #define TARGET_OS_MAC                1
  906.         #define TARGET_OS_WIN32                0
  907.         #define TARGET_OS_UNIX                0
  908.         #define TARGET_RT_LITTLE_ENDIAN        0
  909.         #define TARGET_RT_BIG_ENDIAN        1
  910.         #define TARGET_RT_MAC_CFM            0
  911.         #define TARGET_RT_MAC_MACHO            0
  912.         #define TARGET_RT_MAC_68881            0
  913.         #define PRAGMA_IMPORT                0
  914.         #define PRAGMA_STRUCT_ALIGN            1
  915.         #define PRAGMA_ONCE                     0
  916.         #define PRAGMA_STRUCT_PACK            1
  917.         #define PRAGMA_STRUCT_PACKPUSH        1
  918.         #define PRAGMA_ENUM_PACK            0
  919.         #define PRAGMA_ENUM_ALWAYSINT        0
  920.         #define PRAGMA_ENUM_OPTIONS            0
  921.         #define FOUR_CHAR_CODE(x)            (x)
  922.         #define TYPE_EXTENDED                0
  923.         #define TYPE_LONGLONG                0
  924.         #define TYPE_BOOL                    0
  925.         #define FUNCTION_PASCAL                1
  926.         #define FUNCTION_DECLSPEC            0
  927.         #define FUNCTION_WIN32CC            0            
  928.  
  929.     #elif defined(_M_MPPC)    /* Visual C++ with Macintosh PowerPC target */
  930.         #define TARGET_CPU_PPC              1
  931.         #define TARGET_CPU_68K              0
  932.         #define TARGET_CPU_X86              0
  933.         #define TARGET_CPU_MIPS             0
  934.         #define TARGET_CPU_SPARC            0
  935.         #define TARGET_CPU_ALPHA            0
  936.         #define TARGET_OS_MAC                1
  937.         #define TARGET_OS_WIN32                0
  938.         #define TARGET_OS_UNIX                0
  939.         #define TARGET_RT_LITTLE_ENDIAN        0
  940.         #define TARGET_RT_BIG_ENDIAN        1
  941.         #define TARGET_RT_MAC_CFM            1
  942.         #define TARGET_RT_MAC_MACHO            0
  943.         #define TARGET_RT_MAC_68881            0
  944.         #define PRAGMA_IMPORT                0
  945.         #define PRAGMA_STRUCT_ALIGN            1
  946.         #define PRAGMA_ONCE                     0
  947.         #define PRAGMA_STRUCT_PACK            1
  948.         #define PRAGMA_STRUCT_PACKPUSH        1
  949.         #define PRAGMA_ENUM_PACK            0
  950.         #define PRAGMA_ENUM_ALWAYSINT        0
  951.         #define PRAGMA_ENUM_OPTIONS            0
  952.         #define FOUR_CHAR_CODE(x)            (x)
  953.         #define TYPE_EXTENDED                0
  954.         #define TYPE_LONGLONG                0
  955.         #define TYPE_BOOL                    0
  956.         #define FUNCTION_PASCAL                0
  957.         #define FUNCTION_DECLSPEC            0    
  958.         #define FUNCTION_WIN32CC            0    
  959.  
  960.     #elif defined(_M_IX86)    /* Visual C++ with Intel x86 target */
  961.         #define TARGET_CPU_PPC              0
  962.         #define TARGET_CPU_68K              0
  963.         #define TARGET_CPU_X86              1
  964.         #define TARGET_CPU_MIPS             0
  965.         #define TARGET_CPU_SPARC            0
  966.         #define TARGET_CPU_ALPHA            0
  967.         #define TARGET_OS_MAC                0
  968.         #define TARGET_OS_WIN32                1
  969.         #define TARGET_OS_UNIX                0
  970.         #define TARGET_RT_LITTLE_ENDIAN        1
  971.         #define TARGET_RT_BIG_ENDIAN        0
  972.         #define PRAGMA_IMPORT                0
  973.         #define PRAGMA_STRUCT_ALIGN            0
  974.         #define PRAGMA_ONCE                     0
  975.         #define PRAGMA_STRUCT_PACK            1
  976.         #define PRAGMA_STRUCT_PACKPUSH        1
  977.         #define PRAGMA_ENUM_PACK            0
  978.         #define PRAGMA_ENUM_ALWAYSINT        0
  979.         #define PRAGMA_ENUM_OPTIONS            0
  980.         #define FOUR_CHAR_CODE(x)            (x) 
  981.         #define TYPE_EXTENDED                0
  982.         #define TYPE_LONGLONG                0
  983.         #if defined(__cplusplus) && (_MSC_VER >= 1100)
  984.             #define TYPE_BOOL                1
  985.         #else
  986.             #define TYPE_BOOL                0
  987.         #endif
  988.         #define FUNCTION_PASCAL                0
  989.         #define FUNCTION_DECLSPEC            1    
  990.         #define FUNCTION_WIN32CC            1    
  991.  
  992.         #elif defined(_M_ALPHA)        /* Visual C++ with Dec Alpha target */
  993.         #define TARGET_CPU_PPC              0
  994.         #define TARGET_CPU_68K              0
  995.         #define TARGET_CPU_X86              0
  996.         #define TARGET_CPU_MIPS             0
  997.         #define TARGET_CPU_SPARC            0
  998.         #define TARGET_CPU_ALPHA            1
  999.         #define TARGET_OS_MAC                0
  1000.         #define TARGET_OS_WIN32                1
  1001.         #define TARGET_OS_UNIX                0
  1002.         #define TARGET_RT_LITTLE_ENDIAN        1
  1003.         #define TARGET_RT_BIG_ENDIAN        0
  1004.         #define PRAGMA_IMPORT                0
  1005.         #define PRAGMA_STRUCT_ALIGN            0
  1006.         #define PRAGMA_ONCE                     0
  1007.         #define PRAGMA_STRUCT_PACK            1
  1008.         #define PRAGMA_STRUCT_PACKPUSH        1
  1009.         #define PRAGMA_ENUM_PACK            0
  1010.         #define PRAGMA_ENUM_ALWAYSINT        0
  1011.         #define PRAGMA_ENUM_OPTIONS            0
  1012.         #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  1013.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  1014.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  1015.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  1016.         #define TYPE_EXTENDED                0
  1017.         #define TYPE_LONGLONG                0
  1018.         #define TYPE_BOOL                    0
  1019.         #define FUNCTION_PASCAL                0
  1020.         #define FUNCTION_DECLSPEC            0    
  1021.         #define FUNCTION_WIN32CC            0    
  1022.  
  1023.     #elif defined(_M_PPC)    /* Visual C++ for Windows NT on PowerPC target */
  1024.         #define TARGET_CPU_PPC              1
  1025.         #define TARGET_CPU_68K              0
  1026.         #define TARGET_CPU_X86              0
  1027.         #define TARGET_CPU_MIPS             0
  1028.         #define TARGET_CPU_SPARC            0
  1029.         #define TARGET_CPU_ALPHA            0
  1030.         #define TARGET_OS_MAC                0
  1031.         #define TARGET_OS_WIN32                1
  1032.         #define TARGET_OS_UNIX                0
  1033.         #define TARGET_RT_LITTLE_ENDIAN        1
  1034.         #define TARGET_RT_BIG_ENDIAN        0
  1035.         #define PRAGMA_IMPORT                0
  1036.         #define PRAGMA_STRUCT_ALIGN            0
  1037.         #define PRAGMA_ONCE                     0
  1038.         #define PRAGMA_STRUCT_PACK            1
  1039.         #define PRAGMA_STRUCT_PACKPUSH        1
  1040.         #define PRAGMA_ENUM_PACK            0
  1041.         #define PRAGMA_ENUM_ALWAYSINT        0
  1042.         #define PRAGMA_ENUM_OPTIONS            0
  1043.         #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  1044.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  1045.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  1046.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  1047.         #define TYPE_EXTENDED                0
  1048.         #define TYPE_LONGLONG                0
  1049.         #define TYPE_BOOL                    0
  1050.         #define FUNCTION_PASCAL                0
  1051.         #define FUNCTION_DECLSPEC            0    
  1052.         #define FUNCTION_WIN32CC            0    
  1053.  
  1054.         #elif defined(_M_MRX000)    /* Visual C++ for Windows NT on MIPS target */
  1055.         #define TARGET_CPU_PPC              0
  1056.         #define TARGET_CPU_68K              0
  1057.         #define TARGET_CPU_X86              0
  1058.         #define TARGET_CPU_MIPS             1
  1059.         #define TARGET_CPU_SPARC            0
  1060.         #define TARGET_CPU_ALPHA            0
  1061.         #define TARGET_OS_MAC                0
  1062.         #define TARGET_OS_WIN32                1
  1063.         #define TARGET_OS_UNIX                0
  1064.         #define TARGET_RT_LITTLE_ENDIAN        1
  1065.         #define TARGET_RT_BIG_ENDIAN        0
  1066.         #define PRAGMA_IMPORT                0
  1067.         #define PRAGMA_STRUCT_ALIGN            0
  1068.         #define PRAGMA_ONCE                     0
  1069.         #define PRAGMA_STRUCT_PACK            1
  1070.         #define PRAGMA_STRUCT_PACKPUSH        1
  1071.         #define PRAGMA_ENUM_PACK            0
  1072.         #define PRAGMA_ENUM_ALWAYSINT        0
  1073.         #define PRAGMA_ENUM_OPTIONS            0
  1074.         #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  1075.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  1076.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  1077.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  1078.         #define TYPE_EXTENDED                0
  1079.         #define TYPE_LONGLONG                0
  1080.         #define TYPE_BOOL                    0
  1081.         #define FUNCTION_PASCAL                0
  1082.         #define FUNCTION_DECLSPEC            0    
  1083.         #define FUNCTION_WIN32CC            0    
  1084.     #endif
  1085.  
  1086.  
  1087. #elif defined(__MOTO__)
  1088.     /*
  1089.         mcc from Motorola, Inc. 
  1090.     */
  1091.     #define TARGET_CPU_PPC              1
  1092.     #define TARGET_CPU_68K              0
  1093.     #define TARGET_CPU_X86              0
  1094.     #define TARGET_CPU_MIPS             0
  1095.     #define TARGET_CPU_SPARC            0        
  1096.     #define TARGET_CPU_ALPHA            0
  1097.     #define TARGET_OS_MAC                1
  1098.     #define TARGET_OS_WIN32                0
  1099.     #define TARGET_OS_UNIX                0
  1100.     #define TARGET_RT_LITTLE_ENDIAN        0
  1101.     #define TARGET_RT_BIG_ENDIAN        1
  1102.     #define TARGET_RT_MAC_CFM            1
  1103.     #define TARGET_RT_MAC_MACHO            0
  1104.     #define TARGET_RT_MAC_68881            0
  1105.     #define PRAGMA_IMPORT                0            /* how is this detected ?? */
  1106.     #define PRAGMA_STRUCT_ALIGN            1
  1107.     #if __MOTO__ >= 40702                             /* MCC version 4.7.2 */
  1108.       #define PRAGMA_ONCE                 1
  1109.     #else
  1110.       #define PRAGMA_ONCE                 0
  1111.     #endif
  1112.     #define PRAGMA_STRUCT_PACK            0
  1113.     #define PRAGMA_STRUCT_PACKPUSH        0
  1114.     #define PRAGMA_ENUM_PACK            0
  1115.     #define PRAGMA_ENUM_ALWAYSINT        0
  1116.     #define PRAGMA_ENUM_OPTIONS            0
  1117.     #define FOUR_CHAR_CODE(x)            (x)
  1118.     #define TYPE_LONGLONG                0            /* how is this detected ?? */
  1119.     #ifdef _BOOL
  1120.         #define TYPE_BOOL                1            
  1121.     #else
  1122.         #define TYPE_BOOL                0            
  1123.     #endif
  1124.     #define TYPE_EXTENDED                0
  1125.     #define FUNCTION_PASCAL                0
  1126.     #define FUNCTION_DECLSPEC            0    
  1127.     #define FUNCTION_WIN32CC            0    
  1128.  
  1129.  
  1130.  
  1131. #elif defined(_MIPS_ISA)
  1132.     /*
  1133.         MIPSpro compiler from Silicon Graphics Inc.
  1134.     */
  1135.     #define TARGET_CPU_PPC              0
  1136.     #define TARGET_CPU_68K              0
  1137.     #define TARGET_CPU_X86              0
  1138.     #define TARGET_CPU_MIPS             1
  1139.     #define TARGET_CPU_SPARC            0        
  1140.     #define TARGET_CPU_ALPHA            0
  1141.     #define TARGET_OS_MAC                0
  1142.     #define TARGET_OS_WIN32                0
  1143.     #define TARGET_OS_UNIX                1
  1144.     #define TARGET_RT_LITTLE_ENDIAN        0
  1145.     #define TARGET_RT_BIG_ENDIAN        1
  1146.     #define PRAGMA_IMPORT                0
  1147.     #define PRAGMA_STRUCT_ALIGN            0
  1148.     #define PRAGMA_ONCE                    0
  1149.     #define PRAGMA_STRUCT_PACK            1
  1150.     #define PRAGMA_STRUCT_PACKPUSH        0
  1151.     #define PRAGMA_ENUM_PACK            0
  1152.     #define PRAGMA_ENUM_ALWAYSINT        0
  1153.     #define PRAGMA_ENUM_OPTIONS            0
  1154.     #define FOUR_CHAR_CODE(x)            (x)
  1155.     #define TYPE_EXTENDED                0
  1156.     #define TYPE_LONGLONG                0
  1157.     #define TYPE_BOOL                    0
  1158.     #define FUNCTION_PASCAL                0
  1159.     #define FUNCTION_DECLSPEC            0    
  1160.     #define FUNCTION_WIN32CC            0    
  1161.  
  1162.  
  1163. #elif defined(__sparc)
  1164.     /*
  1165.         SPARCompiler compiler from Sun Microsystems Inc.
  1166.     */
  1167.     #define TARGET_CPU_PPC              0
  1168.     #define TARGET_CPU_68K              0
  1169.     #define TARGET_CPU_X86              0
  1170.     #define TARGET_CPU_MIPS             0
  1171.     #define TARGET_CPU_SPARC            1        
  1172.     #define TARGET_CPU_ALPHA            0
  1173.     #define TARGET_OS_MAC                0
  1174.     #define TARGET_OS_WIN32                0
  1175.     #define TARGET_OS_UNIX                1
  1176.     #define TARGET_RT_LITTLE_ENDIAN        0
  1177.     #define TARGET_RT_BIG_ENDIAN        1
  1178.     #define PRAGMA_IMPORT                0
  1179.     #define PRAGMA_STRUCT_ALIGN            0
  1180.     #define PRAGMA_ONCE                    0
  1181.     #define PRAGMA_STRUCT_PACK            1
  1182.     #define PRAGMA_STRUCT_PACKPUSH        0
  1183.     #define PRAGMA_ENUM_PACK            0
  1184.     #define PRAGMA_ENUM_ALWAYSINT        0
  1185.     #define PRAGMA_ENUM_OPTIONS            0
  1186.     #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  1187.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  1188.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  1189.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  1190.     #define TYPE_EXTENDED                0
  1191.     #define TYPE_LONGLONG                0
  1192.     #define TYPE_BOOL                    0
  1193.     #define FUNCTION_PASCAL                0
  1194.     #define FUNCTION_DECLSPEC            0    
  1195.     #define FUNCTION_WIN32CC            0    
  1196.  
  1197.  
  1198. #else
  1199.     /*
  1200.         Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
  1201.     */
  1202.     #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
  1203.         #define TARGET_CPU_68K   0
  1204.         #define TARGET_CPU_X86   0
  1205.         #define TARGET_CPU_MIPS  0
  1206.         #define TARGET_CPU_SPARC 0
  1207.         #define TARGET_CPU_ALPHA 0
  1208.     #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
  1209.         #define TARGET_CPU_PPC   0
  1210.         #define TARGET_CPU_X86   0
  1211.         #define TARGET_CPU_MIPS  0
  1212.         #define TARGET_CPU_SPARC 0
  1213.         #define TARGET_CPU_ALPHA 0
  1214.     #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
  1215.         #define TARGET_CPU_PPC   0
  1216.         #define TARGET_CPU_68K   0
  1217.         #define TARGET_CPU_MIPS  0
  1218.         #define TARGET_CPU_SPARC 0
  1219.         #define TARGET_CPU_ALPHA 0
  1220.     #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
  1221.         #define TARGET_CPU_PPC   0
  1222.         #define TARGET_CPU_68K   0
  1223.         #define TARGET_CPU_X86   0
  1224.         #define TARGET_CPU_SPARC 0
  1225.         #define TARGET_CPU_ALPHA 0
  1226.     #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
  1227.         #define TARGET_CPU_PPC   0
  1228.         #define TARGET_CPU_68K   0
  1229.         #define TARGET_CPU_X86   0
  1230.         #define TARGET_CPU_MIPS  0
  1231.         #define TARGET_CPU_ALPHA 0
  1232.     #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
  1233.         #define TARGET_CPU_PPC   0
  1234.         #define TARGET_CPU_68K   0
  1235.         #define TARGET_CPU_X86   0
  1236.         #define TARGET_CPU_MIPS  0
  1237.         #define TARGET_CPU_SPARC 0
  1238.  
  1239.         
  1240.     #else
  1241.         /*
  1242.             NOTE:    If your compiler errors out here then support for your compiler 
  1243.                     has not yet been added to ConditionalMacros.h.  
  1244.                     
  1245.                     ConditionalMacros.h is designed to be plug-and-play.  It auto detects
  1246.                     which compiler is being run and configures the TARGET_ conditionals
  1247.                     appropriately.  
  1248.                     
  1249.                     The short term work around is to set the TARGET_CPU_ and TARGET_OS_
  1250.                     on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)
  1251.                     
  1252.                     The long term solution is to add a new case to this file which
  1253.                     auto detects your compiler and sets up the TARGET_ conditionals.
  1254.                     If you do this, send the changes you made to devsupport@apple.com
  1255.                     to get it integrated into the next release of ConditionalMacros.h.
  1256.         */
  1257.         #error ConditionalMacros.h: unknown compiler (see comment above)
  1258.         #define TARGET_CPU_PPC   0
  1259.         #define TARGET_CPU_68K   0
  1260.         #define TARGET_CPU_X86   0
  1261.         #define TARGET_CPU_MIPS  0
  1262.         #define TARGET_CPU_SPARC 0
  1263.         #define TARGET_CPU_ALPHA 0
  1264.     #endif
  1265.     
  1266.  
  1267.  
  1268.     #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
  1269.         #define TARGET_OS_WIN32  0
  1270.         #define TARGET_OS_UNIX   0
  1271.     #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
  1272.         #define TARGET_OS_MAC    0
  1273.         #define TARGET_OS_UNIX   0
  1274.     #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
  1275.         #define TARGET_OS_MAC    0
  1276.         #define TARGET_OS_WIN32  0
  1277.     #elif TARGET_CPU_PPC || TARGET_CPU_68K
  1278.         #define TARGET_OS_MAC    1
  1279.         #define TARGET_OS_WIN32  0
  1280.         #define TARGET_OS_UNIX   0
  1281.     #else
  1282.         #error ConditionalMacros.h: unknown target OS (see comment above)
  1283.     #endif
  1284.  
  1285.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1286.         #if TARGET_OS_MAC
  1287.             #define TARGET_RT_LITTLE_ENDIAN        0
  1288.             #define TARGET_RT_BIG_ENDIAN        1
  1289.         #elif TARGET_OS_WIN32
  1290.             #define TARGET_RT_LITTLE_ENDIAN        1
  1291.             #define TARGET_RT_BIG_ENDIAN        0
  1292.         #endif
  1293.     #endif
  1294.         
  1295.     #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1296.         #define TARGET_RT_LITTLE_ENDIAN        !TARGET_RT_BIG_ENDIAN
  1297.     #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
  1298.         #define TARGET_RT_BIG_ENDIAN        !TARGET_RT_LITTLE_ENDIAN
  1299.     #endif
  1300.     
  1301.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1302.         #error unknown endianess of target processor
  1303.     #endif
  1304.  
  1305.     #if TARGET_OS_MAC
  1306.     #ifndef TARGET_RT_MAC_CFM
  1307.     #define TARGET_RT_MAC_CFM            TARGET_CPU_PPC
  1308.     #endif
  1309.     #ifndef TARGET_RT_MAC_68881
  1310.     #define TARGET_RT_MAC_68881            0
  1311.     #endif
  1312.         #ifndef TARGET_RT_MAC_MACHO
  1313.         #define TARGET_RT_MAC_MACHO            !TARGET_RT_MAC_CFM
  1314.         #endif        
  1315.     #endif
  1316.  
  1317.  
  1318.         
  1319.     #ifndef PRAGMA_IMPORT
  1320.     #define PRAGMA_IMPORT                0
  1321.     #endif
  1322.     #ifndef PRAGMA_STRUCT_ALIGN
  1323.     #define PRAGMA_STRUCT_ALIGN            0
  1324.     #endif
  1325.     #ifndef PRAGMA_ONCE
  1326.     #define PRAGMA_ONCE                    0
  1327.     #endif
  1328.     #ifndef PRAGMA_STRUCT_PACK
  1329.     #define PRAGMA_STRUCT_PACK            0
  1330.     #endif
  1331.     #ifndef PRAGMA_STRUCT_PACKPUSH
  1332.     #define PRAGMA_STRUCT_PACKPUSH        0
  1333.     #endif
  1334.     #ifndef PRAGMA_ENUM_PACK
  1335.     #define PRAGMA_ENUM_PACK            0
  1336.     #endif
  1337.     #ifndef PRAGMA_ENUM_ALWAYSINT
  1338.     #define PRAGMA_ENUM_ALWAYSINT        0
  1339.     #endif
  1340.     #ifndef PRAGMA_ENUM_OPTIONS
  1341.     #define PRAGMA_ENUM_OPTIONS            0
  1342.     #endif
  1343.     #ifndef FOUR_CHAR_CODE
  1344.     #define FOUR_CHAR_CODE(x)            (x)
  1345.     #endif
  1346.  
  1347.     #ifndef TYPE_EXTENDED
  1348.     #define TYPE_EXTENDED                0
  1349.     #endif
  1350.     #ifndef TYPE_LONGLONG
  1351.     #define TYPE_LONGLONG                0
  1352.     #endif
  1353.     #ifndef TYPE_BOOL
  1354.     #define TYPE_BOOL                    0
  1355.     #endif
  1356.     #ifndef FUNCTION_PASCAL
  1357.     #define FUNCTION_PASCAL                0
  1358.     #endif
  1359.     #ifndef FUNCTION_DECLSPEC
  1360.     #define FUNCTION_DECLSPEC            0
  1361.     #endif
  1362.     #ifndef FUNCTION_WIN32CC
  1363.     #define FUNCTION_WIN32CC            0
  1364.     #endif
  1365. #endif
  1366.  
  1367.  
  1368.  
  1369.  
  1370. /****************************************************************************************************
  1371.  
  1372.     Under MacOS, the classic 68k runtime has two calling conventions: pascal or C
  1373.     Under Win32, there are two calling conventions: __cdecl or __stdcall
  1374.     Headers and implementation files can use the following macros to make their
  1375.     source more portable by hiding the calling convention details:
  1376.  
  1377.     EXTERN_API≈    
  1378.     These macros are used to specify the calling convention on a function prototype.
  1379.  
  1380.         EXTERN_API                - Classic 68k: pascal, Win32: __cdecl
  1381.         EXTERN_API_C            - Classic 68k: C,      Win32: __cdecl
  1382.         EXTERN_API_STDCALL        - Classic 68k: pascal, Win32: __stdcall
  1383.         EXTERN_API_C_STDCALL    - Classic 68k: C,      Win32: __stdcall
  1384.  
  1385.  
  1386.     DEFINE_API≈    
  1387.     These macros are used to specify the calling convention on a function definition.
  1388.  
  1389.         DEFINE_API                - Classic 68k: pascal, Win32: __cdecl
  1390.         DEFINE_API_C            - Classic 68k: C,      Win32: __cdecl
  1391.         DEFINE_API_STDCALL        - Classic 68k: pascal, Win32: __stdcall
  1392.         DEFINE_API_C_STDCALL    - Classic 68k: C,      Win32: __stdcall
  1393.  
  1394.  
  1395.     CALLBACK_API≈    
  1396.     These macros are used to specify the calling convention of a function pointer.
  1397.  
  1398.         CALLBACK_API            - Classic 68k: pascal, Win32: __stdcall
  1399.         CALLBACK_API_C            - Classic 68k: C,      Win32: __stdcall
  1400.         CALLBACK_API_STDCALL    - Classic 68k: pascal, Win32: __cdecl
  1401.         CALLBACK_API_C_STDCALL    - Classic 68k: C,      Win32: __cdecl
  1402.  
  1403. ****************************************************************************************************/
  1404. #if TARGET_OS_WIN32
  1405.     /* QuickTime for Windows builds do not want __declspec(dllimport) */
  1406.     #undef FUNCTION_DECLSPEC
  1407.     #define FUNCTION_DECLSPEC 0
  1408. #endif
  1409.  
  1410. #if FUNCTION_PASCAL && !FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
  1411.     /* compiler supports pascal keyword only  */
  1412.     #define EXTERN_API(_type)                        extern pascal _type
  1413.     #define EXTERN_API_C(_type)                        extern        _type
  1414.     #define EXTERN_API_STDCALL(_type)                extern pascal _type
  1415.     #define EXTERN_API_C_STDCALL(_type)                extern        _type
  1416.     
  1417.     #define DEFINE_API(_type)                        pascal _type
  1418.     #define DEFINE_API_C(_type)                               _type
  1419.     #define DEFINE_API_STDCALL(_type)                pascal _type
  1420.     #define DEFINE_API_C_STDCALL(_type)                       _type
  1421.     
  1422.     #define CALLBACK_API(_type, _name)                pascal _type (*_name)
  1423.     #define CALLBACK_API_C(_type, _name)                   _type (*_name)
  1424.     #define CALLBACK_API_STDCALL(_type, _name)        pascal _type (*_name)
  1425.     #define CALLBACK_API_C_STDCALL(_type, _name)           _type (*_name)
  1426.  
  1427. #elif FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
  1428.     /* compiler supports pascal and __declspec() */
  1429.     #define EXTERN_API(_type)                        extern pascal __declspec(dllimport) _type
  1430.     #define EXTERN_API_C(_type)                        extern        __declspec(dllimport) _type
  1431.     #define EXTERN_API_STDCALL(_type)                extern pascal __declspec(dllimport) _type
  1432.     #define EXTERN_API_C_STDCALL(_type)                extern        __declspec(dllimport) _type
  1433.     
  1434.     #define DEFINE_API(_type)                        pascal __declspec(dllexport) _type
  1435.     #define DEFINE_API_C(_type)                               __declspec(dllexport) _type
  1436.     #define DEFINE_API_STDCALL(_type)                pascal __declspec(dllexport) _type
  1437.     #define DEFINE_API_C_STDCALL(_type)                       __declspec(dllexport) _type
  1438.  
  1439.     #define CALLBACK_API(_type, _name)                pascal _type (*_name)
  1440.     #define CALLBACK_API_C(_type, _name)                   _type (*_name)
  1441.     #define CALLBACK_API_STDCALL(_type, _name)        pascal _type (*_name)
  1442.     #define CALLBACK_API_C_STDCALL(_type, _name)           _type (*_name)
  1443.  
  1444. #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && !FUNCTION_WIN32CC
  1445.     /* compiler supports __declspec() */
  1446.     #define EXTERN_API(_type)                        extern __declspec(dllimport) _type
  1447.     #define EXTERN_API_C(_type)                        extern __declspec(dllimport) _type
  1448.     #define EXTERN_API_STDCALL(_type)                extern __declspec(dllimport) _type
  1449.     #define EXTERN_API_C_STDCALL(_type)                extern __declspec(dllimport) _type
  1450.     
  1451.     #define DEFINE_API(_type)                        __declspec(dllexport) _type    
  1452.     #define DEFINE_API_C(_type)                        __declspec(dllexport) _type
  1453.     #define DEFINE_API_STDCALL(_type)                __declspec(dllexport) _type
  1454.     #define DEFINE_API_C_STDCALL(_type)                __declspec(dllexport) _type
  1455.  
  1456.     #define CALLBACK_API(_type, _name)                _type ( * _name)
  1457.     #define CALLBACK_API_C(_type, _name)            _type ( * _name)
  1458.     #define CALLBACK_API_STDCALL(_type, _name)        _type ( * _name)
  1459.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type ( * _name)
  1460.  
  1461. #elif !FUNCTION_PASCAL && FUNCTION_DECLSPEC && FUNCTION_WIN32CC
  1462.     /* compiler supports __declspec() and __cdecl */
  1463.     #define EXTERN_API(_type)                        __declspec(dllimport) _type __cdecl
  1464.     #define EXTERN_API_C(_type)                        __declspec(dllimport) _type __cdecl
  1465.     #define EXTERN_API_STDCALL(_type)                __declspec(dllimport) _type __stdcall
  1466.     #define EXTERN_API_C_STDCALL(_type)                __declspec(dllimport) _type __stdcall
  1467.     
  1468.     #define DEFINE_API(_type)                        __declspec(dllexport) _type __cdecl
  1469.     #define DEFINE_API_C(_type)                        __declspec(dllexport) _type __cdecl
  1470.     #define DEFINE_API_STDCALL(_type)                __declspec(dllexport) _type __stdcall
  1471.     #define DEFINE_API_C_STDCALL(_type)                __declspec(dllexport) _type __stdcall
  1472.     
  1473.     #define CALLBACK_API(_type, _name)                _type (__cdecl * _name)
  1474.     #define CALLBACK_API_C(_type, _name)            _type (__cdecl * _name)
  1475.     #define CALLBACK_API_STDCALL(_type, _name)        _type (__stdcall * _name)
  1476.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (__stdcall * _name)
  1477.  
  1478. #elif !FUNCTION_PASCAL && !FUNCTION_DECLSPEC && FUNCTION_WIN32CC
  1479.     /* compiler supports __cdecl */
  1480.     #define EXTERN_API(_type)                        _type __cdecl
  1481.     #define EXTERN_API_C(_type)                        _type __cdecl
  1482.     #define EXTERN_API_STDCALL(_type)                _type __stdcall
  1483.     #define EXTERN_API_C_STDCALL(_type)                _type __stdcall
  1484.     
  1485.     #define DEFINE_API(_type)                        _type __cdecl
  1486.     #define DEFINE_API_C(_type)                        _type __cdecl
  1487.     #define DEFINE_API_STDCALL(_type)                _type __stdcall
  1488.     #define DEFINE_API_C_STDCALL(_type)                _type __stdcall
  1489.     
  1490.     #define CALLBACK_API(_type, _name)                _type (__cdecl * _name)
  1491.     #define CALLBACK_API_C(_type, _name)            _type (__cdecl * _name)
  1492.     #define CALLBACK_API_STDCALL(_type, _name)        _type (__stdcall * _name)
  1493.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (__stdcall * _name)
  1494.  
  1495. #else 
  1496.     /* compiler supports no extensions */
  1497.     #define EXTERN_API(_type)                        extern _type
  1498.     #define EXTERN_API_C(_type)                        extern _type
  1499.     #define EXTERN_API_STDCALL(_type)                extern _type
  1500.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1501.     
  1502.     #define DEFINE_API(_type)                        _type
  1503.     #define DEFINE_API_C(_type)                        _type
  1504.     #define DEFINE_API_STDCALL(_type)                _type
  1505.     #define DEFINE_API_C_STDCALL(_type)                _type
  1506.  
  1507.     #define CALLBACK_API(_type, _name)                _type ( * _name)
  1508.     #define CALLBACK_API_C(_type, _name)            _type ( * _name)
  1509.     #define CALLBACK_API_STDCALL(_type, _name)        _type ( * _name)
  1510.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type ( * _name)
  1511. #endif
  1512.  
  1513. /****************************************************************************************************
  1514.     
  1515.     Set up TARGET_API_≈_≈ values
  1516.  
  1517. ****************************************************************************************************/
  1518. #if TARGET_OS_MAC
  1519. #if !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON)
  1520. /* No TARGET_API_MAC_* predefind on command line */
  1521. #if defined(TARGET_CARBON) && TARGET_CARBON
  1522. /* grandfather in use of TARGET_CARBON */
  1523. #define TARGET_API_MAC_OS8 0
  1524. #define TARGET_API_MAC_CARBON 1
  1525. #define TARGET_API_MAC_OSX 0
  1526. #elif defined(forCarbon) && forCarbon
  1527. /* grandfather in use of forCarbon */
  1528. #define TARGET_API_MAC_OS8 0
  1529. #define TARGET_API_MAC_CARBON 1
  1530. #define TARGET_API_MAC_OSX 0
  1531. #elif TARGET_CPU_PPC && TARGET_RT_MAC_CFM
  1532. /* Looks like CFM style PPC compiler */
  1533. #define TARGET_API_MAC_OS8 1
  1534. #define TARGET_API_MAC_CARBON 1
  1535. #define TARGET_API_MAC_OSX 0
  1536. #elif TARGET_RT_MAC_MACHO
  1537. /* Looks like MachO style PPC compiler */
  1538. #define TARGET_API_MAC_OS8 0
  1539. #define TARGET_API_MAC_CARBON 1
  1540. #define TARGET_API_MAC_OSX 1
  1541. #else
  1542. /* 68k or some other compiler */
  1543. #define TARGET_API_MAC_OS8 1
  1544. #define TARGET_API_MAC_CARBON 0
  1545. #define TARGET_API_MAC_OSX 0
  1546. #endif  /*  */
  1547.  
  1548. #else
  1549. #ifndef TARGET_API_MAC_OS8
  1550. #define TARGET_API_MAC_OS8 0
  1551. #endif  /* !defined(TARGET_API_MAC_OS8) */
  1552.  
  1553. #ifndef TARGET_API_MAC_CARBON
  1554. #define TARGET_API_MAC_CARBON 0
  1555. #endif  /* !defined(TARGET_API_MAC_CARBON) */
  1556.  
  1557. #ifndef TARGET_API_MAC_OSX
  1558. #define TARGET_API_MAC_OSX 0
  1559. #endif  /* !defined(TARGET_API_MAC_OSX) */
  1560.  
  1561. #endif  /* !defined(TARGET_API_MAC_OS8) && !defined(TARGET_API_MAC_OSX) && !defined(TARGET_API_MAC_CARBON) */
  1562.  
  1563. #if TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX
  1564. #error TARGET_API_MAC_OS8 and TARGET_API_MAC_OSX are mutually exclusive
  1565. #endif  /* TARGET_API_MAC_OS8 && TARGET_API_MAC_OSX */
  1566.  
  1567. #if !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX
  1568. #error At least one of TARGET_API_MAC_* must be true
  1569. #endif  /* !TARGET_API_MAC_OS8 && !TARGET_API_MAC_CARBON && !TARGET_API_MAC_OSX */
  1570.  
  1571. #endif  /* TARGET_OS_MAC */
  1572.  
  1573. /* Support source code still using TARGET_CARBON */
  1574. #ifndef TARGET_CARBON
  1575. #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
  1576. #define TARGET_CARBON 1
  1577. #else
  1578. #define TARGET_CARBON 0
  1579. #endif  /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */
  1580.  
  1581. #endif  /* !defined(TARGET_CARBON) */
  1582.  
  1583. /* Support source code still using TARGET_CARBON */
  1584. #ifndef forCarbon
  1585. #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
  1586. #define forCarbon 1
  1587. #else
  1588. #define forCarbon 0
  1589. #endif  /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */
  1590.  
  1591. #endif  /* !defined(forCarbon) */
  1592.  
  1593. /****************************************************************************************************
  1594.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  1595.  
  1596.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  1597.     GENERATING68K            - Compiler is generating 68k family instructions
  1598.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  1599.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  1600.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  1601.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  1602.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  1603.     CGLUESUPPORTED            - Clients can use all lowercase toolbox functions that take C strings instead of pascal strings
  1604.  
  1605. ****************************************************************************************************/
  1606. #if TARGET_OS_MAC && TARGET_API_MAC_OS8
  1607. #define GENERATINGPOWERPC TARGET_CPU_PPC
  1608. #define GENERATING68K TARGET_CPU_68K
  1609. #define GENERATING68881 TARGET_RT_MAC_68881
  1610. #define GENERATINGCFM TARGET_RT_MAC_CFM
  1611. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  1612. #ifndef CGLUESUPPORTED
  1613. #define CGLUESUPPORTED 0
  1614. #endif  /* !defined(CGLUESUPPORTED) */
  1615.  
  1616. #ifndef OLDROUTINELOCATIONS
  1617. #define OLDROUTINELOCATIONS 0
  1618. #endif  /* !defined(OLDROUTINELOCATIONS) */
  1619.  
  1620. #define PRAGMA_ALIGN_SUPPORTED    PRAGMA_STRUCT_ALIGN
  1621. #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
  1622. #endif  /* TARGET_OS_MAC && TARGET_API_MAC_OS8 */
  1623.  
  1624.  
  1625.  
  1626. /****************************************************************************************************
  1627.  
  1628.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  1629.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  1630.                               are now more sensitive to change because CFM binds by name.  In the 
  1631.                               past, system routine names were compiled out to just an A-Trap.  
  1632.                               Macros have been added that each map an old name to its new name.  
  1633.                               This allows old routine names to be used in existing source files,
  1634.                               but the macros only work if OLDROUTINENAMES is true.  This support
  1635.                               will be removed in the near future.  Thus, all source code should 
  1636.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  1637.                               to see if your code has any old names left in it.
  1638.     
  1639. ****************************************************************************************************/
  1640. #ifndef OLDROUTINENAMES
  1641. #define OLDROUTINENAMES 0
  1642. #endif  /* !defined(OLDROUTINENAMES) */
  1643.  
  1644.  
  1645.  
  1646. /****************************************************************************************************
  1647.     The following macros isolate the use of 68K inlines in function prototypes.
  1648.     On the Mac OS under the Classic 68K runtime, function prototypes were followed
  1649.     by a list of 68K opcodes which the compiler inserted in the generated code instead
  1650.     of a JSR.  Under Classic 68K on the Mac OS, this macro will put the opcodes
  1651.     in the right syntax.  For all other OS's and runtimes the macro suppress the opcodes.
  1652.     Example:
  1653.     
  1654.         EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
  1655.              ONEWORDINLINE(0xA8F6);
  1656.     
  1657. ****************************************************************************************************/
  1658.  
  1659. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1660.     #define ONEWORDINLINE(w1) = w1
  1661.     #define TWOWORDINLINE(w1,w2) = {w1,w2}
  1662.     #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
  1663.     #define FOURWORDINLINE(w1,w2,w3,w4)  = {w1,w2,w3,w4}
  1664.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
  1665.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)     = {w1,w2,w3,w4,w5,w6}
  1666.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)      = {w1,w2,w3,w4,w5,w6,w7}
  1667.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)      = {w1,w2,w3,w4,w5,w6,w7,w8}
  1668.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
  1669.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)  = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
  1670.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
  1671.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12}
  1672. #else
  1673.     #define ONEWORDINLINE(w1)
  1674.     #define TWOWORDINLINE(w1,w2)
  1675.     #define THREEWORDINLINE(w1,w2,w3)
  1676.     #define FOURWORDINLINE(w1,w2,w3,w4)
  1677.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
  1678.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
  1679.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
  1680.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
  1681.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
  1682.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
  1683.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
  1684.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
  1685. #endif
  1686.  
  1687.  
  1688. /****************************************************************************************************
  1689.  
  1690.     TARGET_CARBON                    - default: false. Switches all of the above as described.  Overrides all others
  1691.                                     - NOTE: If you set TARGET_CARBON to 1, then the other switches will be setup by
  1692.                                             ConditionalMacros, and should not be set manually.
  1693.  
  1694.     If you wish to do development for pre-Carbon Systems, you can set the following:
  1695.  
  1696.     OPAQUE_TOOLBOX_STRUCTS            - default: false. True for Carbon builds, hides struct fields.
  1697.     OPAQUE_UPP_TYPES                - default: false. True for Carbon builds, UPP types are unique.
  1698.     ACCESSOR_CALLS_ARE_FUNCTIONS    - default: false. True for Carbon builds, preserve old #define-style accessors
  1699.     CALL_NOT_IN_CARBON                 - default: true.  False for Carbon builds, hide calls not supported in Carbon
  1700.     
  1701.     MIXEDMODE_CALLS_ARE_FUNCTIONS    - deprecated.
  1702.  
  1703. ****************************************************************************************************/
  1704. #if TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8
  1705. #define OPAQUE_TOOLBOX_STRUCTS 1
  1706. #ifndef OPAQUE_UPP_TYPES
  1707. #define OPAQUE_UPP_TYPES 1
  1708. #endif  /* !defined(OPAQUE_UPP_TYPES) */
  1709.  
  1710. #define ACCESSOR_CALLS_ARE_FUNCTIONS 1
  1711. #define CALL_NOT_IN_CARBON 0
  1712. #define MIXEDMODE_CALLS_ARE_FUNCTIONS 1
  1713. #else
  1714. #ifndef OPAQUE_TOOLBOX_STRUCTS
  1715. #define OPAQUE_TOOLBOX_STRUCTS 0
  1716. #endif  /* !defined(OPAQUE_TOOLBOX_STRUCTS) */
  1717.  
  1718. #ifndef OPAQUE_UPP_TYPES
  1719. #define OPAQUE_UPP_TYPES 0
  1720. #endif  /* !defined(OPAQUE_UPP_TYPES) */
  1721.  
  1722. #ifndef ACCESSOR_CALLS_ARE_FUNCTIONS
  1723. #define ACCESSOR_CALLS_ARE_FUNCTIONS 0
  1724. #endif  /* !defined(ACCESSOR_CALLS_ARE_FUNCTIONS) */
  1725.  
  1726. /*
  1727.      * It's possible to have ACCESSOR_CALLS_ARE_FUNCTIONS set to true and OPAQUE_TOOLBOX_STRUCTS
  1728.      * set to false, but not the other way around, so make sure the defines are not set this way.
  1729.      */
  1730. #if OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  1731. #error OPAQUE_TOOLBOX_STRUCTS cannot be true when ACCESSOR_CALLS_ARE_FUNCTIONS is false
  1732. #endif  /* OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS */
  1733.  
  1734. #ifndef CALL_NOT_IN_CARBON
  1735. #define CALL_NOT_IN_CARBON 1
  1736. #endif  /* !defined(CALL_NOT_IN_CARBON) */
  1737.  
  1738. #ifndef MIXEDMODE_CALLS_ARE_FUNCTIONS
  1739. #define MIXEDMODE_CALLS_ARE_FUNCTIONS 0
  1740. #endif  /* !defined(MIXEDMODE_CALLS_ARE_FUNCTIONS) */
  1741.  
  1742. #endif  /* TARGET_API_MAC_CARBON && !TARGET_API_MAC_OS8 */
  1743.  
  1744.  
  1745.  
  1746. #endif /* __CONDITIONALMACROS__ */
  1747.  
  1748.